// pages/calc/calc.js
Page({
  data: {
    totalCount: 3
  },
  goToDetail(){
    wx.navigateTo({
      url: '/pages/detail/datail',
    })
  },
  decCount() {
   let num = this.data.totalCount
   num--
   if( num < 0){
     wx.showToast({
       icon: "none",
       title: '已经最少了',
     })
     return
   }
   this.setData({
     totalCount: num
   })
  },
  addCount() {
    let num = this.data.totalCount
    num++
    if (num > 5) {
      wx.showToast({
        icon: 'none',
        title: '没有更多了~',
      })
      return
    }
    this.setData({
      totalCount: num
    })
  }
})